{% set dff_api_title = "AlibabaCloud-DDos Collection" %}
{% set dff_api_crontab = "* * * * *" %}

{% extends "base_template" %}
{% block import %}
{{ super() }}
import integration_alibabacloud_ddoscoo__main as obj_main
import integration_alibabacloud_monitor__main as monitor_main
{% endblock %}

{% block account %}
{{ super() }}
{% endblock %}

{% block collect_configs %}
{% if account_config.area == 'cn' %}
   {% set select_area = "cn-hangzhou" %}
   {% set namespace = "acs_newbgpddos" %}
{% else %}   
    {% set select_area = "ap-southeast-1" %}
    {% set namespace = "acs_ddosdip" %}
{% endif %}


collector_configs = {
    'regions': [ '{{ select_area }}' ]
}

monitor_configs = {
    'targets': [
        {
            'namespace': '{{ namespace }}',
            {% if collector.metrics %}
            'metrics'  : {{ repr(collector.metrics) }}
            {% else %}
            'metrics'  : []
            {% endif %}
        }
    ]
}
{% endblock %}

{% block filters%}
{% endblock %}

{% block run %}
{{ super() }}
{% endblock %}
